package org.act.xservices.rt.xcontainer.framework;

import java.util.concurrent.ExecutorService;

import org.act.xservices.rt.xcontainer.framework.config.IConfigElement;
import org.act.xservices.rt.xcontainer.framework.lifecycle.ILifecycle;
import org.act.xservices.rt.xcontainer.framework.objectpool.IDispatchSource;
import org.act.xservices.rt.xcontainer.framework.objectpool.IDispatchTarget;

/**
 * 
 * @version 1.0 2007-03-20
 * @author Lizq [lizq@act.buaa.edu.cn]
 * @since JDK1.5
 */
public interface IConnector<T, V> extends ILifecycle{

	/**
	 * Get the name of the connector
	 * @return   Get the name of the connector
	 */
	public String getConnectorName();

	/**
	 * Get the description of the connector
	 * @return   the description of the connector
	 */
	public String getDescription();
	
	/**
	 * Get the configuration of the connector
	 * @return
	 */
	public IConfigElement getConnectorConfiguration();

	/**
	 * return ConnectorEnvironment
	 * @return
	 */
	public IConnectorEnvironment<T, V> getConnectorEnvironment();
	
	/**
	 * initialize the connector
	 * @param connectorEnvironment
	 */
	public void initialize(IConfigElement connectorConfigElement, 
			IRuntimeContainer runtimeContainer);
	
	
	//---ObjectPool---
	public IDispatchSource<T> getInputSource();
	
//	public void setInputSource(IDispatchSource<T> inputSource);
	
	public IDispatchTarget<V> getInputTarget();
	
//	public void setInputTarget(IDispatchTarget<V> inputTarget);
	
	public IDispatchSource<V> getOutputSource();
	
//	public void setOutputSource(IDispatchSource<V> outputSource);
	
	public IDispatchTarget<T> getOutputTarget();
	
//	public void setOutputTarget(IDispatchTarget<T> outputTarget);
	
	//---ThreadPool---
	public ExecutorService getInputThreadpool();
	
//	public void setInputThreadpool(ExecutorService inputThreadpool);
	
	public ExecutorService getOutputThreadpool();
	
//	public void setOutputThreadpool(ExecutorService outputThreadpool);

}
